const https = require("https");
https.get('https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY',(resp)=>{
    let data = '';
    resp.on('data',(chunk)=>{
        data+=chunk;
    })
    resp.on('end',()=>{
        console.log(JSON.parse(data));
    })
}).on('error',(err)=>{
    console.log("error",err.message);
})